﻿using System;
using System.ComponentModel;
using System.Windows;
using Xceed.Wpf.Toolkit.PropertyGrid;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;

namespace RandomMobileNumber.Models
{
    public class Number
    {
        /// <summary>
        /// 手机号
        /// </summary>
        [Category("号码")]
        [DisplayName("号码")]
        [ReadOnly(true)]
        public string number { get; set; }
        /// <summary>
        /// 已售
        /// </summary>
        [Category("号码")]
        [DisplayName("已售")]
        [ItemsSource(typeof(BoolValueItemsSource))]
        public int sold { get; set; }

        /// <summary>
        /// 靓号
        /// </summary>
        [Category("号码")]
        [DisplayName("靓号")]
        [ItemsSource(typeof(BoolValueItemsSource))]
        public int IsGoodNumber { get; set; }
        /// <summary>
        /// 预留
        /// </summary>
        [Category("号码")]
        [DisplayName("预留")]
        [ItemsSource(typeof(BoolValueItemsSource))]
        public int reserved { get; set; }

        /// <summary>
        /// 费用
        /// </summary>
        [Category("号码")]
        [DisplayName("金额")]
        public decimal cost { get; set; }

        [Category("联系人")]
        [DisplayName("姓名")]
        public string manName { get; set; }

        [Category("联系人")]
        [DisplayName("身份证号")]
        public string manId { get; set; }

        [Category("联系人")]
        [DisplayName("电话")]
        public string manPhone { get; set; }

        [Browsable(false)]
        public DateTime soldDate { get; set; }
    }

    internal class BoolValueItemsSource : IItemsSource
    {
        public ItemCollection GetValues()
        {
            ItemCollection lst = new ItemCollection();
            lst.Add(0, "否");
            lst.Add(1, "是");
            return lst;
        }
    }
}
